import wireformat;
class ccc : Message 
{
	int  quersy_=18;
	int _cached_size_;
	byte[] _unknown_fields;
	byte[] unknown_fields()
	{
		return _unknown_fields;
	}
	byte[] mutable_unknown_fields()
	{
		return _unknown_fields.dup;
	}
	int GetCachedSize()
	{
		return _cached_size_;
	}
	void SetCachedSize(int size )
	{
		_cached_size_ = size;
		 
	}
	uint _has_bits_[(1 + 31 ) / 32];
	bool has_bit(int index )
	{
		return (_has_bits_[index / 32] & (1u << (index % 32 ))) != 0;
	}
	void set_bit(int index )
	{
		_has_bits_[index / 32] |= (1u << (index % 32 ));
	}
	void clear_bit(int index )
	{
		_has_bits_[index / 32] &= ~(1u << (index % 32 ));
	}
	int quersy()
	{
		return quersy_;
	}
	bool has_quersy()
	{
		return has_bit(1 );
	}
	void clear_quersy()
	{
		quersy_ =18;
		clear_bit(1 );
	}
	void set_quersy(int value )
	{
		set_bit(1 );
		quersy_ =value;
	}
	byte[] Serialize()
	{
		byte[] rst;
		if(has_quersy )
			rst ~= toVarint(quersy(), 3, Type.TYPE_INT32 );
		rst ~= _unknown_fields;
		return rst;
	}
	static ccc Deserialize(ref byte[] input )
	{
		return new ccc(input );
	}
	this()
	{
		
	}
	this(ref byte[] input )
	{
		while(input.length>0 )
		{
			uint tag = GetTag(input );
			byte[] value = GetFieldValue(input, tag );
			switch(GetTagFieldNumber(tag ))
			{
				case 3:
if(GetTagWireType(tag )!=GetWireTypeForFieldType(Type.TYPE_INT32 ))
					throw new Exception("message not match" );
				set_quersy(cast(int )Decode!(uint )(value ));
				break;
				default:
 _unknown_fields ~=EncodeBuf(tag )~value ;
			}
		}
}
}
class ccc2 : Message 
{
	int  quersyw_=18;
	long  quersyc_=18;
	static ExtensionIdentifier!(long  ) quersyd_ = ExtensionIdentifier!(long  )(0, Type.TYPE_INT64, 10 );
	static ExtensionIdentifier!(long  ) quersy_ = ExtensionIdentifier!(long  )(0, Type.TYPE_INT64, 11 );
	int _cached_size_;
	byte[] _unknown_fields;
	byte[] unknown_fields()
	{
		return _unknown_fields;
	}
	byte[] mutable_unknown_fields()
	{
		return _unknown_fields.dup;
	}
	int GetCachedSize()
	{
		return _cached_size_;
	}
	void SetCachedSize(int size )
	{
		_cached_size_ = size;
		 
	}
	uint _has_bits_[(2 + 31 ) / 32];
	bool has_bit(int index )
	{
		return (_has_bits_[index / 32] & (1u << (index % 32 ))) != 0;
	}
	void set_bit(int index )
	{
		_has_bits_[index / 32] |= (1u << (index % 32 ));
	}
	void clear_bit(int index )
	{
		_has_bits_[index / 32] &= ~(1u << (index % 32 ));
	}
	int quersyw()
	{
		return quersyw_;
	}
	bool has_quersyw()
	{
		return has_bit(1 );
	}
	void clear_quersyw()
	{
		quersyw_ =18;
		clear_bit(1 );
	}
	void set_quersyw(int value )
	{
		set_bit(1 );
		quersyw_ =value;
	}
	long quersyc()
	{
		return quersyc_;
	}
	bool has_quersyc()
	{
		return has_bit(2 );
	}
	void clear_quersyc()
	{
		quersyc_ =18;
		clear_bit(2 );
	}
	void set_quersyc(long value )
	{
		set_bit(2 );
		quersyc_ =value;
	}
	import extension;
	byte[] Serialize()
	{
		byte[] rst;
		if(has_quersyw )
			rst ~= toVarint(quersyw(), 3, Type.TYPE_INT32 );
		if(has_quersyc )
			rst ~= toVarint(quersyc(), 1, Type.TYPE_INT64 );
		rst ~= _unknown_fields;
		return rst;
	}
	static ccc2 Deserialize(ref byte[] input )
	{
		return new ccc2(input );
	}
	this()
	{
		
	}
	this(ref byte[] input )
	{
		while(input.length>0 )
		{
			uint tag = GetTag(input );
			byte[] value = GetFieldValue(input, tag );
			switch(GetTagFieldNumber(tag ))
			{
				case 3:
if(GetTagWireType(tag )!=GetWireTypeForFieldType(Type.TYPE_INT32 ))
					throw new Exception("message not match" );
				set_quersyw(cast(int )Decode!(uint )(value ));
				break;
				case 1:
if(GetTagWireType(tag )!=GetWireTypeForFieldType(Type.TYPE_INT64 ))
					throw new Exception("message not match" );
				set_quersyc(cast(long )Decode!(ulong )(value ));
				break;
				default:
 _unknown_fields ~=EncodeBuf(tag )~value ;
			}
		}
}
static class ccc3 : Message 
	{
		bool  quersyc_;
		int _cached_size_;
		byte[] _unknown_fields;
		byte[] unknown_fields()
		{
			return _unknown_fields;
		}
		byte[] mutable_unknown_fields()
		{
			return _unknown_fields.dup;
		}
		int GetCachedSize()
		{
			return _cached_size_;
		}
		void SetCachedSize(int size )
		{
			_cached_size_ = size;
			 
		}
		uint _has_bits_[(1 + 31 ) / 32];
		bool has_bit(int index )
		{
			return (_has_bits_[index / 32] & (1u << (index % 32 ))) != 0;
		}
		void set_bit(int index )
		{
			_has_bits_[index / 32] |= (1u << (index % 32 ));
		}
		void clear_bit(int index )
		{
			_has_bits_[index / 32] &= ~(1u << (index % 32 ));
		}
		bool quersyc()
		{
			return quersyc_;
		}
		bool has_quersyc()
		{
			return has_bit(1 );
		}
		void clear_quersyc()
		{
			clear_bit(1 );
		}
		void set_quersyc(bool value )
		{
			set_bit(1 );
			quersyc_ =value;
		}
		byte[] Serialize()
		{
			byte[] rst;
			if(has_quersyc )
				rst ~= toVarint(quersyc(), 1, Type.TYPE_BOOL );
			rst ~= _unknown_fields;
			return rst;
		}
		static ccc3 Deserialize(ref byte[] input )
		{
			return new ccc3(input );
		}
		this()
		{
			
		}
		this(ref byte[] input )
		{
			while(input.length>0 )
			{
				uint tag = GetTag(input );
				byte[] value = GetFieldValue(input, tag );
				switch(GetTagFieldNumber(tag ))
				{
					case 1:
if(GetTagWireType(tag )!=GetWireTypeForFieldType(Type.TYPE_BOOL ))
						throw new Exception("message not match" );
					set_quersyc(((Decode!(uint )(value )== 1 )?true:false ));
					break;
					default:
 _unknown_fields ~=EncodeBuf(tag )~value ;
				}
			}
}
}
}
class ccc1 : Message 
{
	int  quersy_=18;
	ccc3  quersyv_;
	int _cached_size_;
	byte[] _unknown_fields;
	byte[] unknown_fields()
	{
		return _unknown_fields;
	}
	byte[] mutable_unknown_fields()
	{
		return _unknown_fields.dup;
	}
	int GetCachedSize()
	{
		return _cached_size_;
	}
	void SetCachedSize(int size )
	{
		_cached_size_ = size;
		 
	}
	uint _has_bits_[(2 + 31 ) / 32];
	bool has_bit(int index )
	{
		return (_has_bits_[index / 32] & (1u << (index % 32 ))) != 0;
	}
	void set_bit(int index )
	{
		_has_bits_[index / 32] |= (1u << (index % 32 ));
	}
	void clear_bit(int index )
	{
		_has_bits_[index / 32] &= ~(1u << (index % 32 ));
	}
	int quersy()
	{
		return quersy_;
	}
	bool has_quersy()
	{
		return has_bit(1 );
	}
	void clear_quersy()
	{
		quersy_ =18;
		clear_bit(1 );
	}
	void set_quersy(int value )
	{
		set_bit(1 );
		quersy_ =value;
	}
	bool has_quersyv()
	{
		return has_bit(2 );
	}
	void clear_quersyv()
	{
		quersyv_=null;
		clear_bit(2 );
	}
	ccc3 quersyv()
	{
		return quersyv;
	}
	ccc3 mutable_quersyv()
	{
		set_bit(2 );
		if(quersyv_ == null  )quersyv_ =new ccc3;
		return quersyv_;
	}
	void set_quersyv(ccc3 value )
	{
		quersyv_=value;
	}
	enum c 
	{
		FOO = 2, BAR = 1, 
	}
	byte[] Serialize()
	{
		byte[] rst;
		if(has_quersy )
			rst ~= toVarint(quersy(), 3, Type.TYPE_INT32 );
		if(has_quersyv )
			rst ~=  toByteString(quersyv().Serialize(), 4, Type.TYPE_MESSAGE );
		rst ~= _unknown_fields;
		return rst;
	}
	static ccc1 Deserialize(ref byte[] input )
	{
		return new ccc1(input );
	}
	this()
	{
		
	}
	this(ref byte[] input )
	{
		while(input.length>0 )
		{
			uint tag = GetTag(input );
			byte[] value = GetFieldValue(input, tag );
			switch(GetTagFieldNumber(tag ))
			{
				case 3:
if(GetTagWireType(tag )!=GetWireTypeForFieldType(Type.TYPE_INT32 ))
					throw new Exception("message not match" );
				set_quersy(cast(int )Decode!(uint )(value ));
				break;
				case 4:
if(GetTagWireType(tag )!=GetWireTypeForFieldType(Type.TYPE_MESSAGE ))
					throw new Exception("message not match" );
				set_quersyv(quersyv_.Deserialize(value ));
				break;
				default:
 _unknown_fields ~=EncodeBuf(tag )~value ;
			}
		}
}
static class ccc3 : Message 
	{
		long  quersyc_=18;
		int  quersyd_=c.FOO;
		int _cached_size_;
		byte[] _unknown_fields;
		byte[] unknown_fields()
		{
			return _unknown_fields;
		}
		byte[] mutable_unknown_fields()
		{
			return _unknown_fields.dup;
		}
		int GetCachedSize()
		{
			return _cached_size_;
		}
		void SetCachedSize(int size )
		{
			_cached_size_ = size;
			 
		}
		uint _has_bits_[(2 + 31 ) / 32];
		bool has_bit(int index )
		{
			return (_has_bits_[index / 32] & (1u << (index % 32 ))) != 0;
		}
		void set_bit(int index )
		{
			_has_bits_[index / 32] |= (1u << (index % 32 ));
		}
		void clear_bit(int index )
		{
			_has_bits_[index / 32] &= ~(1u << (index % 32 ));
		}
		long quersyc()
		{
			return quersyc_;
		}
		bool has_quersyc()
		{
			return has_bit(1 );
		}
		void clear_quersyc()
		{
			quersyc_ =18;
			clear_bit(1 );
		}
		void set_quersyc(long value )
		{
			set_bit(1 );
			quersyc_ =value;
		}
		c quersyd()
		{
			return cast(c )quersyd_;
		}
		bool has_quersyd()
		{
			return has_bit(2 );
		}
		void clear_quersyd()
		{
			quersyd_ =c.FOO;
			clear_bit(2 );
		}
		void set_quersyd(c value )
		{
			set_bit(2 );
			quersyd_ =value;
		}
		byte[] Serialize()
		{
			byte[] rst;
			if(has_quersyc )
				rst ~= toVarint(quersyc(), 1, Type.TYPE_INT64 );
			if(has_quersyd )
				rst ~= toVarint(cast(uint )quersyd(), 4, Type.TYPE_ENUM );
			rst ~= _unknown_fields;
			return rst;
		}
		static ccc3 Deserialize(ref byte[] input )
		{
			return new ccc3(input );
		}
		this()
		{
			
		}
		this(ref byte[] input )
		{
			while(input.length>0 )
			{
				uint tag = GetTag(input );
				byte[] value = GetFieldValue(input, tag );
				switch(GetTagFieldNumber(tag ))
				{
					case 1:
if(GetTagWireType(tag )!=GetWireTypeForFieldType(Type.TYPE_INT64 ))
						throw new Exception("message not match" );
					set_quersyc(cast(long )Decode!(ulong )(value ));
					break;
					case 4:
if(GetTagWireType(tag )!=GetWireTypeForFieldType(Type.TYPE_ENUM ))
						throw new Exception("message not match" );
					set_quersyd(cast(c )Decode!(uint )(value ));
					break;
					default:
 _unknown_fields ~=EncodeBuf(tag )~value ;
				}
			}
}
}
}
